<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tinyOS: 计数信号量</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">tinyOS
   &#160;<span id="projectnumber">v1.00</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">计数信号量</div>  </div>
</div><!--header-->
<div class="contents">

<p>tinyOS的计数信号量的实现  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct__t_sem.html">_tSem</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct__t_sem_info.html">_tSemInfo</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga3d7db90a4217a81ff9da67050935f66d"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="struct__t_sem.html">_tSem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga3d7db90a4217a81ff9da67050935f66d">tSem</a></td></tr>
<tr class="separator:ga3d7db90a4217a81ff9da67050935f66d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9ec305c3826b08a2777ef8f212693fe1"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="struct__t_sem_info.html">_tSemInfo</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga9ec305c3826b08a2777ef8f212693fe1">tSemInfo</a></td></tr>
<tr class="separator:ga9ec305c3826b08a2777ef8f212693fe1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga1a48fab4ce73fc72b1a2ed6fa8771f8e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga1a48fab4ce73fc72b1a2ed6fa8771f8e">tSemInit</a> (<a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga3d7db90a4217a81ff9da67050935f66d">tSem</a> *sem, uint32_t startCount, uint32_t maxCount)</td></tr>
<tr class="separator:ga1a48fab4ce73fc72b1a2ed6fa8771f8e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9946734436c2a1ab849654a72e0de0ce"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga9946734436c2a1ab849654a72e0de0ce">tSemWait</a> (<a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga3d7db90a4217a81ff9da67050935f66d">tSem</a> *sem, uint32_t waitTicks)</td></tr>
<tr class="separator:ga9946734436c2a1ab849654a72e0de0ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac0e48f858c5a926f878b2815702307a0"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#gac0e48f858c5a926f878b2815702307a0">tSemNoWaitGet</a> (<a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga3d7db90a4217a81ff9da67050935f66d">tSem</a> *sem)</td></tr>
<tr class="separator:gac0e48f858c5a926f878b2815702307a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7222219d3c608a5f9b941e17b1872731"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga7222219d3c608a5f9b941e17b1872731">tSemNotify</a> (<a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga3d7db90a4217a81ff9da67050935f66d">tSem</a> *sem)</td></tr>
<tr class="separator:ga7222219d3c608a5f9b941e17b1872731"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga477f63052c68e3a6ff28b7302291b3cf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga477f63052c68e3a6ff28b7302291b3cf">tSemGetInfo</a> (<a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga3d7db90a4217a81ff9da67050935f66d">tSem</a> *sem, <a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga9ec305c3826b08a2777ef8f212693fe1">tSemInfo</a> *info)</td></tr>
<tr class="separator:ga477f63052c68e3a6ff28b7302291b3cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab00399e50380c504049be19c6e5f81ab"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#gab00399e50380c504049be19c6e5f81ab">tSemDestroy</a> (<a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga3d7db90a4217a81ff9da67050935f66d">tSem</a> *sem)</td></tr>
<tr class="separator:gab00399e50380c504049be19c6e5f81ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>tinyOS的计数信号量的实现 </p>
<dl class="section author"><dt>Author</dt><dd>01课堂 lishutong </dd></dl>
<dl class="section date"><dt>Date</dt><dd>2017-06-01 </dd></dl>
<dl class="section version"><dt>Version</dt><dd>1.0 </dd></dl>
<dl class="section copyright"><dt>Copyright</dt><dd>版权所有，禁止用于商业用途 </dd></dl>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga3d7db90a4217a81ff9da67050935f66d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3d7db90a4217a81ff9da67050935f66d">&#9670;&nbsp;</a></span>tSem</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="struct__t_sem.html">_tSem</a>  <a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga3d7db90a4217a81ff9da67050935f66d">tSem</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ga9ec305c3826b08a2777ef8f212693fe1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9ec305c3826b08a2777ef8f212693fe1">&#9670;&nbsp;</a></span>tSemInfo</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="struct__t_sem_info.html">_tSemInfo</a>  <a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga9ec305c3826b08a2777ef8f212693fe1">tSemInfo</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="gab00399e50380c504049be19c6e5f81ab"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab00399e50380c504049be19c6e5f81ab">&#9670;&nbsp;</a></span>tSemDestroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t tSemDestroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga3d7db90a4217a81ff9da67050935f66d">tSem</a> *&#160;</td>
          <td class="paramname"><em>sem</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>销毁信号量 </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sem</td><td>需要销毁的信号量 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>因销毁该信号量而唤醒的任务数量 </dd></dl>

<p class="definition">Definition at line <a class="el" href="t_sem_8c_source.html#l00134">134</a> of file <a class="el" href="t_sem_8c_source.html">tSem.c</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_gab00399e50380c504049be19c6e5f81ab_cgraph.png" border="0" usemap="#group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_gab00399e50380c504049be19c6e5f81ab_cgraph" alt=""/></div>
<map name="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_gab00399e50380c504049be19c6e5f81ab_cgraph" id="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_gab00399e50380c504049be19c6e5f81ab_cgraph">
<area shape="rect" id="node2" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74" title="tTaskEnterCritical" alt="" coords="329,203,454,228"/>
<area shape="rect" id="node3" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gace850c06cc2fc2f07296e1eb4552030a" title="tEventRemoveAll" alt="" coords="152,151,275,176"/>
<area shape="rect" id="node11" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53" title="tTaskExitCritical" alt="" coords="334,252,449,277"/>
<area shape="rect" id="node12" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gaeb48f2b93febc962f23d9a6a72db9d8e" title="任务调度接口。通过它来选择下一个具体的任务，然后切换至该任务运行。 " alt="" coords="168,303,259,328"/>
<area shape="rect" id="node4" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gad01c0c24187a334e78e7ba6d677306cb" title="tListCount" alt="" coords="351,104,432,129"/>
<area shape="rect" id="node5" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gaf2dc8b31ed5ec5aac0b7bebc21448a78" title="tListRemoveFirst" alt="" coords="331,153,452,179"/>
<area shape="rect" id="node6" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga5086649a1a0f0337850b059e6d28807e" title="将延时的任务从延时队列中唤醒 " alt="" coords="325,5,458,31"/>
<area shape="rect" id="node8" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab7c2dfbda696e43a8c35ab97731837a0" title="将任务设置为就绪状态 " alt="" coords="334,55,448,80"/>
<area shape="rect" id="node7" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga58e2fef327c5254062441ec2f8a101a6" title="tListRemove" alt="" coords="527,5,622,31"/>
<area shape="rect" id="node9" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga6278d548e9b37d514acbebc25617f1b6" title="tListAddLast" alt="" coords="527,55,622,80"/>
<area shape="rect" id="node10" href="group___xE4_xBD_x8D_xE5_x9B_xBE_xE7_xBB_x93_xE6_x9E_x84.html#ga77e6ff906f4751ea7f055562b94cad54" title="tBitmapSet" alt="" coords="531,104,618,129"/>
<area shape="rect" id="node13" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gac9f0cf7d9a8b992eb7f43c84aeb1ddca" title="获取当前最高优先级且可运行的任务 " alt="" coords="323,301,460,327"/>
<area shape="rect" id="node17" href="group___hooks_xE6_x89_xA9_xE5_xB1_x95.html#gaf5f3298fd391c362d819f3a765834091" title="tHooksTaskSwitch" alt="" coords="327,351,456,376"/>
<area shape="rect" id="node18" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga0cd2c487eac7429325389fa3ee59867d" title="tTaskSwitch" alt="" coords="346,400,437,425"/>
<area shape="rect" id="node14" href="group___xE4_xBD_x8D_xE5_x9B_xBE_xE7_xBB_x93_xE6_x9E_x84.html#gae86fbb239ac4694acf71b11c7cc6b479" title="tBitmapGetFirstSet" alt="" coords="508,327,641,352"/>
<area shape="rect" id="node16" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga9203dd58a7f2dafed784c397861dd203" title="tListFirst" alt="" coords="539,277,610,303"/>
<area shape="rect" id="node15" href="group___xE4_xBD_x8D_xE5_x9B_xBE_xE7_xBB_x93_xE6_x9E_x84.html#ga24bbbd4e9273fa00e125cbf600c851c1" title="tBitmapPosCount" alt="" coords="689,327,815,352"/>
</map>
</div>

</div>
</div>
<a id="ga477f63052c68e3a6ff28b7302291b3cf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga477f63052c68e3a6ff28b7302291b3cf">&#9670;&nbsp;</a></span>tSemGetInfo()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tSemGetInfo </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga3d7db90a4217a81ff9da67050935f66d">tSem</a> *&#160;</td>
          <td class="paramname"><em>sem</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga9ec305c3826b08a2777ef8f212693fe1">tSemInfo</a> *&#160;</td>
          <td class="paramname"><em>info</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>查询信号量的状态信息 </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sem</td><td>查询的信号量 </td></tr>
    <tr><td class="paramname">info</td><td>状态查询存储的位置 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="t_sem_8c_source.html#l00118">118</a> of file <a class="el" href="t_sem_8c_source.html">tSem.c</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga477f63052c68e3a6ff28b7302291b3cf_cgraph.png" border="0" usemap="#group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga477f63052c68e3a6ff28b7302291b3cf_cgraph" alt=""/></div>
<map name="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga477f63052c68e3a6ff28b7302291b3cf_cgraph" id="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga477f63052c68e3a6ff28b7302291b3cf_cgraph">
<area shape="rect" id="node2" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74" title="tTaskEnterCritical" alt="" coords="318,5,443,31"/>
<area shape="rect" id="node3" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga312cd12071f2d18172b4020079af49a2" title="tEventWaitCount" alt="" coords="150,55,270,80"/>
<area shape="rect" id="node5" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53" title="tTaskExitCritical" alt="" coords="323,104,439,129"/>
<area shape="rect" id="node4" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gad01c0c24187a334e78e7ba6d677306cb" title="tListCount" alt="" coords="340,55,422,80"/>
</map>
</div>

</div>
</div>
<a id="ga1a48fab4ce73fc72b1a2ed6fa8771f8e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1a48fab4ce73fc72b1a2ed6fa8771f8e">&#9670;&nbsp;</a></span>tSemInit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tSemInit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga3d7db90a4217a81ff9da67050935f66d">tSem</a> *&#160;</td>
          <td class="paramname"><em>sem</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>startCount</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>maxCount</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>初始化信号量 </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">startCount</td><td>初始的计数 </td></tr>
    <tr><td class="paramname">maxCount</td><td>最大计数，如果为0，则不限数量 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="t_sem_8c_source.html#l00024">24</a> of file <a class="el" href="t_sem_8c_source.html">tSem.c</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga1a48fab4ce73fc72b1a2ed6fa8771f8e_cgraph.png" border="0" usemap="#group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga1a48fab4ce73fc72b1a2ed6fa8771f8e_cgraph" alt=""/></div>
<map name="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga1a48fab4ce73fc72b1a2ed6fa8771f8e_cgraph" id="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga1a48fab4ce73fc72b1a2ed6fa8771f8e_cgraph">
<area shape="rect" id="node2" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga5ca43de9442770133c4c2ac38e696049" title="tEventInit" alt="" coords="124,5,200,31"/>
<area shape="rect" id="node3" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gab4cbecbc9ce397733c027de83ce17f81" title="tListInit" alt="" coords="248,5,312,31"/>
</map>
</div>
<div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga1a48fab4ce73fc72b1a2ed6fa8771f8e_icgraph.png" border="0" usemap="#group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga1a48fab4ce73fc72b1a2ed6fa8771f8e_icgraph" alt=""/></div>
<map name="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga1a48fab4ce73fc72b1a2ed6fa8771f8e_icgraph" id="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga1a48fab4ce73fc72b1a2ed6fa8771f8e_icgraph">
<area shape="rect" id="node2" href="group___xE8_xBD_xAF_xE5_xAE_x9A_xE6_x97_xB6_xE5_x99_xA8.html#ga62301aa36a38ff645bdf05136b3fd6cf" title="tTimerModuleInit" alt="" coords="124,5,244,31"/>
<area shape="rect" id="node3" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gae66f6b31b5ad750f1fe042a706a4e3d4" title="系统入口，完成所有功能的创建，空闲任务的创建等功能 " alt="" coords="292,5,342,31"/>
</map>
</div>

</div>
</div>
<a id="ga7222219d3c608a5f9b941e17b1872731"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7222219d3c608a5f9b941e17b1872731">&#9670;&nbsp;</a></span>tSemNotify()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tSemNotify </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga3d7db90a4217a81ff9da67050935f66d">tSem</a> *&#160;</td>
          <td class="paramname"><em>sem</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>通知信号量可用，唤醒等待队列中的一个任务，或者将计数+1 </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sem</td><td>操作的信号量 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="t_sem_8c_source.html#l00088">88</a> of file <a class="el" href="t_sem_8c_source.html">tSem.c</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga7222219d3c608a5f9b941e17b1872731_cgraph.png" border="0" usemap="#group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga7222219d3c608a5f9b941e17b1872731_cgraph" alt=""/></div>
<map name="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga7222219d3c608a5f9b941e17b1872731_cgraph" id="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga7222219d3c608a5f9b941e17b1872731_cgraph">
<area shape="rect" id="node2" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74" title="tTaskEnterCritical" alt="" coords="314,55,439,80"/>
<area shape="rect" id="node3" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga312cd12071f2d18172b4020079af49a2" title="tEventWaitCount" alt="" coords="140,5,261,31"/>
<area shape="rect" id="node5" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53" title="tTaskExitCritical" alt="" coords="319,104,435,129"/>
<area shape="rect" id="node6" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gae1e675e01faa9fd2a37ab29b2092d646" title="tEventWakeUp" alt="" coords="145,157,255,183"/>
<area shape="rect" id="node13" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gaeb48f2b93febc962f23d9a6a72db9d8e" title="任务调度接口。通过它来选择下一个具体的任务，然后切换至该任务运行。 " alt="" coords="155,253,245,279"/>
<area shape="rect" id="node4" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gad01c0c24187a334e78e7ba6d677306cb" title="tListCount" alt="" coords="336,5,418,31"/>
<area shape="rect" id="node7" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gaf2dc8b31ed5ec5aac0b7bebc21448a78" title="tListRemoveFirst" alt="" coords="316,153,438,179"/>
<area shape="rect" id="node8" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga5086649a1a0f0337850b059e6d28807e" title="将延时的任务从延时队列中唤醒 " alt="" coords="311,203,443,228"/>
<area shape="rect" id="node10" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab7c2dfbda696e43a8c35ab97731837a0" title="将任务设置为就绪状态 " alt="" coords="320,252,434,277"/>
<area shape="rect" id="node9" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga58e2fef327c5254062441ec2f8a101a6" title="tListRemove" alt="" coords="512,153,608,179"/>
<area shape="rect" id="node11" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga6278d548e9b37d514acbebc25617f1b6" title="tListAddLast" alt="" coords="513,252,607,277"/>
<area shape="rect" id="node12" href="group___xE4_xBD_x8D_xE5_x9B_xBE_xE7_xBB_x93_xE6_x9E_x84.html#ga77e6ff906f4751ea7f055562b94cad54" title="tBitmapSet" alt="" coords="517,203,603,228"/>
<area shape="rect" id="node14" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gac9f0cf7d9a8b992eb7f43c84aeb1ddca" title="获取当前最高优先级且可运行的任务 " alt="" coords="309,301,445,327"/>
<area shape="rect" id="node18" href="group___hooks_xE6_x89_xA9_xE5_xB1_x95.html#gaf5f3298fd391c362d819f3a765834091" title="tHooksTaskSwitch" alt="" coords="312,351,442,376"/>
<area shape="rect" id="node19" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga0cd2c487eac7429325389fa3ee59867d" title="tTaskSwitch" alt="" coords="331,400,423,425"/>
<area shape="rect" id="node15" href="group___xE4_xBD_x8D_xE5_x9B_xBE_xE7_xBB_x93_xE6_x9E_x84.html#gae86fbb239ac4694acf71b11c7cc6b479" title="tBitmapGetFirstSet" alt="" coords="493,351,627,376"/>
<area shape="rect" id="node17" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga9203dd58a7f2dafed784c397861dd203" title="tListFirst" alt="" coords="524,301,596,327"/>
<area shape="rect" id="node16" href="group___xE4_xBD_x8D_xE5_x9B_xBE_xE7_xBB_x93_xE6_x9E_x84.html#ga24bbbd4e9273fa00e125cbf600c851c1" title="tBitmapPosCount" alt="" coords="675,351,800,376"/>
</map>
</div>
<div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga7222219d3c608a5f9b941e17b1872731_icgraph.png" border="0" usemap="#group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga7222219d3c608a5f9b941e17b1872731_icgraph" alt=""/></div>
<map name="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga7222219d3c608a5f9b941e17b1872731_icgraph" id="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga7222219d3c608a5f9b941e17b1872731_icgraph">
<area shape="rect" id="node2" href="group___xE8_xBD_xAF_xE5_xAE_x9A_xE6_x97_xB6_xE5_x99_xA8.html#ga7a8932a1c16f4eb96e7a0620272d846e" title="tTimerStart" alt="" coords="140,5,227,31"/>
<area shape="rect" id="node3" href="group___xE8_xBD_xAF_xE5_xAE_x9A_xE6_x97_xB6_xE5_x99_xA8.html#ga7090133d856e1d8bfa5d619e7be397cb" title="tTimerStop" alt="" coords="140,55,226,80"/>
<area shape="rect" id="node4" href="group___xE8_xBD_xAF_xE5_xAE_x9A_xE6_x97_xB6_xE5_x99_xA8.html#ga34c554ef3abd95f382165dae86122aef" title="tTimerDestroy" alt="" coords="275,55,379,80"/>
</map>
</div>

</div>
</div>
<a id="gac0e48f858c5a926f878b2815702307a0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac0e48f858c5a926f878b2815702307a0">&#9670;&nbsp;</a></span>tSemNoWaitGet()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t tSemNoWaitGet </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga3d7db90a4217a81ff9da67050935f66d">tSem</a> *&#160;</td>
          <td class="paramname"><em>sem</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>获取信号量，如果信号量计数不可用，则立即退回 </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sem</td><td>等待的信号量 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>获取结果, tErrorResourceUnavaliable.tErrorNoError,tErrorTimeout </dd></dl>

<p class="definition">Definition at line <a class="el" href="t_sem_8c_source.html#l00068">68</a> of file <a class="el" href="t_sem_8c_source.html">tSem.c</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_gac0e48f858c5a926f878b2815702307a0_cgraph.png" border="0" usemap="#group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_gac0e48f858c5a926f878b2815702307a0_cgraph" alt=""/></div>
<map name="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_gac0e48f858c5a926f878b2815702307a0_cgraph" id="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_gac0e48f858c5a926f878b2815702307a0_cgraph">
<area shape="rect" id="node2" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74" title="tTaskEnterCritical" alt="" coords="171,5,296,31"/>
<area shape="rect" id="node3" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53" title="tTaskExitCritical" alt="" coords="175,55,291,80"/>
</map>
</div>

</div>
</div>
<a id="ga9946734436c2a1ab849654a72e0de0ce"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9946734436c2a1ab849654a72e0de0ce">&#9670;&nbsp;</a></span>tSemWait()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t tSemWait </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga3d7db90a4217a81ff9da67050935f66d">tSem</a> *&#160;</td>
          <td class="paramname"><em>sem</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>waitTicks</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>等待信号量 </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sem</td><td>等待的信号量 </td></tr>
    <tr><td class="paramname">waitTicks</td><td>当信号量计数为0时，等待的ticks数，为0时表示永远等待 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>等待结果,tErrorResourceUnavaliable.tErrorNoError,tErrorTimeout </dd></dl>

<p class="definition">Definition at line <a class="el" href="t_sem_8c_source.html#l00041">41</a> of file <a class="el" href="t_sem_8c_source.html">tSem.c</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga9946734436c2a1ab849654a72e0de0ce_cgraph.png" border="0" usemap="#group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga9946734436c2a1ab849654a72e0de0ce_cgraph" alt=""/></div>
<map name="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga9946734436c2a1ab849654a72e0de0ce_cgraph" id="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga9946734436c2a1ab849654a72e0de0ce_cgraph">
<area shape="rect" id="node2" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74" title="tTaskEnterCritical" alt="" coords="276,153,401,179"/>
<area shape="rect" id="node3" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53" title="tTaskExitCritical" alt="" coords="281,203,396,228"/>
<area shape="rect" id="node4" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga0bbda829b0d83072138caad66f98899a" title="tEventWait" alt="" coords="134,255,220,280"/>
<area shape="rect" id="node11" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gaeb48f2b93febc962f23d9a6a72db9d8e" title="任务调度接口。通过它来选择下一个具体的任务，然后切换至该任务运行。 " alt="" coords="132,103,222,128"/>
<area shape="rect" id="node5" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f3aa47609478099b79d1520a9baf9b3" title="将任务从就绪列表中移除 " alt="" coords="273,353,404,379"/>
<area shape="rect" id="node9" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga6278d548e9b37d514acbebc25617f1b6" title="tListAddLast" alt="" coords="474,253,569,279"/>
<area shape="rect" id="node10" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga1f612696830f8adeb411745ff719377c" title="将任务加入延时队列中 " alt="" coords="284,252,392,277"/>
<area shape="rect" id="node6" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga58e2fef327c5254062441ec2f8a101a6" title="tListRemove" alt="" coords="474,304,569,329"/>
<area shape="rect" id="node7" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gad01c0c24187a334e78e7ba6d677306cb" title="tListCount" alt="" coords="481,353,562,379"/>
<area shape="rect" id="node8" href="group___xE4_xBD_x8D_xE5_x9B_xBE_xE7_xBB_x93_xE6_x9E_x84.html#ga63a37ae88a06249de873bb54340de517" title="tBitmapClear" alt="" coords="472,403,571,428"/>
<area shape="rect" id="node12" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gac9f0cf7d9a8b992eb7f43c84aeb1ddca" title="获取当前最高优先级且可运行的任务 " alt="" coords="270,55,406,80"/>
<area shape="rect" id="node16" href="group___hooks_xE6_x89_xA9_xE5_xB1_x95.html#gaf5f3298fd391c362d819f3a765834091" title="tHooksTaskSwitch" alt="" coords="274,104,403,129"/>
<area shape="rect" id="node17" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga0cd2c487eac7429325389fa3ee59867d" title="tTaskSwitch" alt="" coords="292,5,384,31"/>
<area shape="rect" id="node13" href="group___xE4_xBD_x8D_xE5_x9B_xBE_xE7_xBB_x93_xE6_x9E_x84.html#gae86fbb239ac4694acf71b11c7cc6b479" title="tBitmapGetFirstSet" alt="" coords="454,31,588,56"/>
<area shape="rect" id="node15" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga9203dd58a7f2dafed784c397861dd203" title="tListFirst" alt="" coords="486,80,557,105"/>
<area shape="rect" id="node14" href="group___xE4_xBD_x8D_xE5_x9B_xBE_xE7_xBB_x93_xE6_x9E_x84.html#ga24bbbd4e9273fa00e125cbf600c851c1" title="tBitmapPosCount" alt="" coords="636,31,761,56"/>
</map>
</div>
<div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga9946734436c2a1ab849654a72e0de0ce_icgraph.png" border="0" usemap="#group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga9946734436c2a1ab849654a72e0de0ce_icgraph" alt=""/></div>
<map name="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga9946734436c2a1ab849654a72e0de0ce_icgraph" id="group___xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_ga9946734436c2a1ab849654a72e0de0ce_icgraph">
<area shape="rect" id="node2" href="group___xE8_xBD_xAF_xE5_xAE_x9A_xE6_x97_xB6_xE5_x99_xA8.html#ga7a8932a1c16f4eb96e7a0620272d846e" title="tTimerStart" alt="" coords="132,5,219,31"/>
<area shape="rect" id="node3" href="group___xE8_xBD_xAF_xE5_xAE_x9A_xE6_x97_xB6_xE5_x99_xA8.html#ga7090133d856e1d8bfa5d619e7be397cb" title="tTimerStop" alt="" coords="132,55,218,80"/>
<area shape="rect" id="node4" href="group___xE8_xBD_xAF_xE5_xAE_x9A_xE6_x97_xB6_xE5_x99_xA8.html#ga34c554ef3abd95f382165dae86122aef" title="tTimerDestroy" alt="" coords="267,55,371,80"/>
</map>
</div>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
